#!/usr/bin/env python
# coding: utf-8
# $Id: ex1consumer.py 9 2009-04-27 16:54:05Z fiorix $
# hello world consumer

import parallels

# This program will be run by ex1producer,
# automatically call reactor.run() and start
# waiting for data...
#
# Once data arrives, it will fire the get()
# method with the data sent by the producer
# as the first argument.
#
# The return value of get() will be sent back
# to the producer.
#
# If, for any reason, the pipe between the
# producer and the consumer is broken, it
# will automatically call reactor.stop() and
# exit sucessfully.
class consumer(parallels.ConsumerProtocol):
    def get(self, item):
	return item + ' from consumer!'

if __name__ == '__main__':
    consumer(runReactor=True)
